/*
 * Copyright 2008 Max Kugland
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.splink.library.logging.logoutput {
	import org.splink.library.logging.LogEvent;					

	/**
	 * Every class which is to be used as output for an <code>ILogger</code> needs to implement
	 * the <code>ILogOutput</code> interface.
	 * 
	 * @author Max Kugland
	 */
	public interface ILogOutput {
		/**
		 * Sets the <code>IOutputFormatter</code> object which is used by <code>ILogOutput</code> 
		 * to format <code>LogEvent</code> objects before sending them to their destination.
		 * 
		 * @param formatter the <code>IOutputFormatter</code>
		 * @see IOutputFormatter
		 */
		function setOuputFormatter(formatter : IOutputFormatter) : void;

		/**
		 * Returns whether the <code>ILogOutput</code> is ready to output <code>LogEvent</code>
		 * objects. This is handy for <code>ILogOutput</code> implementations which for instance 
		 * need to establish a socket connection before beeing able to output anything.
		 * 
		 * @return true if the <code>ILogOutput</code> implementation is ready for usage, otherwise
		 * returns false
		 */
		function getInitialized() : Boolean;

		/**
		 * Loggs a given <code>LogEvent</code>
		 * 
		 * @param event the <code>LogEvent</code> to be logged 
		 */
		function log(event : LogEvent) : void;
	}
}
